﻿<Window x:Class="BBInterfaceNET.Shell"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:conv="clr-namespace:BBInterfaceNET.Converters"
        xmlns:cmds="clr-namespace:BBInterfaceNET.Events.Commands;assembly=BBInterfaceNET.Events"
        xmlns:regions="clr-namespace:Microsoft.Practices.Prism.Regions;assembly=Microsoft.Practices.Prism"
        xmlns:v="clr-namespace:BBInterfaceNET.Views"
        Title="Shell" Height="600" Width="800">
    <Window.Resources>
        <conv:BoolToVisibilityConverter x:Key="conv"/>
        <cmds:CommandReference x:Key="newProjRef" Command="{Binding NewProjectCommand.Command}"/>
        <cmds:CommandReference x:Key="openProjRef" Command="{Binding OpenProjectCommand.Command}"/>
        <cmds:CommandReference x:Key="saveRef" Command="{Binding SaveCommand.Command}"/>
        <cmds:CommandReference x:Key="saveAllRef" Command="{Binding SaveAllCommand.Command}"/>
    </Window.Resources>
    <Window.InputBindings>
        <KeyBinding Command="{StaticResource newProjRef}" Modifiers="Control+Shift" Key="N"/>
        <KeyBinding Command="{StaticResource saveRef}" Modifiers="Control" Key="S"/>
        <KeyBinding Command="{StaticResource saveAllRef}" Modifiers="Control+Shift" Key="S"/>
        <KeyBinding Command="{StaticResource openProjRef}" Modifiers="Control+Shift" Key="O"/>
    </Window.InputBindings>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.Background>
            <RadialGradientBrush Center="0.5,1" GradientOrigin="0.5,1" RadiusX="1" RadiusY="1">
                <GradientStop Offset="0" Color="SteelBlue"/>
                <GradientStop Offset="1" Color="DarkBlue"/>
            </RadialGradientBrush>
        </Grid.Background>
        <Grid>
            <Menu>
                <MenuItem Header="File">
                    <MenuItem Header="{Binding Path=NewProjectCommand.DisplayName}"
                              Command="{Binding Path=NewProjectCommand.Command}"/>
                    <MenuItem Header="{Binding Path=OpenProjectCommand.DisplayName}"
                              Command="{Binding Path=OpenProjectCommand.Command}"/>
                    <MenuItem Header="{Binding Path=CloseProjectCommand.DisplayName}"
                              Command="{Binding Path=CloseProjectCommand.Command}"/>
                    <Separator/>
                    <MenuItem Header="{Binding Path=SaveCommand.DisplayName}"
                              Command="{Binding Path=SaveCommand.Command}"/>
                    <MenuItem Header="{Binding Path=SaveAllCommand.DisplayName}"
                              Command="{Binding Path=SaveAllCommand.Command}"/>
                    <Separator/>
                    <MenuItem Header="{Binding Path=ShutdownCommand.DisplayName}"
                              Command="{Binding Path=ShutdownCommand.Command}"/>                    
                </MenuItem>
                <MenuItem Header="View">
                    <MenuItem Header="Project Explorer"/>
                    <MenuItem Header="Properties Window"/>
                    <MenuItem Header="Toolbox"/>
                    <MenuItem Header="Layout Window"/>
                </MenuItem>
                <MenuItem Header="Project">
                    <MenuItem Header="{Binding Path=GenerateCommand.DisplayName}" Command="{Binding Path=GenerateCommand.Command}"/>
                </MenuItem>
                <MenuItem Header="Help">
                    <MenuItem Header="View Help"/>
                    <MenuItem Header="Report Bug"/>
                    <Separator/>
                    <MenuItem Header="About BBInterfaceNET"/>
                </MenuItem>
                    
            </Menu>
        </Grid>
        <ToolBarTray Grid.Row="1">
            <ToolBar>
                <Button ToolTip="New Project" Command="{Binding Path=NewProjectCommand.Command}">
                    <Image Source="Resources/newProj.png" Width="20"/>
                </Button>
                <Button ToolTip="New File">
                    <Image Source="Resources/NewDocumentHS.png" Width="16"/>
                </Button>
                <Separator/>
                <Button ToolTip="Open Project" Command="{Binding Path=OpenProjectCommand.Command}">
                    <Image Source="Resources/openProj.png" Width="20"/>
                </Button>
                <Button ToolTip="Open File">
                    <Image Source="Resources/OpenHS.png" Width="16"/>
                </Button>
                <Separator/>
                <Button ToolTip="Save" Command="{Binding Path=SaveCommand.Command}">
                    <Image Source="Resources/SaveHS.png" Width="16"/>
                </Button>
                <Button ToolTip="Save All" Command="{Binding Path=SaveAllCommand.Command}">
                    <Image Source="Resources/SaveAllHS.png" Width="16"/>
                </Button>
            </ToolBar>
            <ToolBar>
                <Button Content="{Binding Path=GenerateCommand.DisplayName}" Command="{Binding Path=GenerateCommand.Command}"/>
            </ToolBar>
            <ToolBar>
                <Button Content="Help"/>
            </ToolBar>
        </ToolBarTray>
        <Grid Grid.Row="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"  MinWidth="100"/>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" MinWidth="100" />
            </Grid.ColumnDefinitions>
            <Grid Grid.Column="0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <ContentControl regions:RegionManager.RegionName="ExplorerRegion" />

                <GridSplitter HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                          Height="3" Background="LightGray" Grid.Row="1"/>
                <ContentControl regions:RegionManager.RegionName="LayoutRegion" Grid.Row="2" />
            </Grid>
            <GridSplitter Width="3" Background="LightGray" HorizontalAlignment="Stretch"
                      VerticalAlignment="Stretch" Grid.Column="1"/>
            
            <ContentControl Grid.Column="2" regions:RegionManager.RegionName="DesignerRegion"
                            />
            <GridSplitter Width="3" Background="LightGray" HorizontalAlignment="Stretch"
                      VerticalAlignment="Stretch" Grid.Column="3"/>
            <Grid Grid.Column="4">
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <ContentControl  regions:RegionManager.RegionName="ToolboxRegion" />
                <GridSplitter Grid.Row="1" HorizontalAlignment="Stretch"
                          VerticalAlignment="Stretch" Height="3" Background="LightGray"/>
                <ContentControl Grid.Row="2" regions:RegionManager.RegionName="PropertiesRegion"/>
            </Grid>
        </Grid>
        <Grid Grid.Row="3">
            <StatusBar>
                <StatusBarItem>
                    <ProgressBar Width="70" Height="12"
                                 IsIndeterminate="{Binding Generating}"
                                 Visibility="{Binding Generating, Converter={StaticResource conv}}"
                                 />
                </StatusBarItem>
            </StatusBar>
        </Grid>
    </Grid>
</Window>
